package com.woniuxy.backup;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.woniuxy.utils.Utils;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

public class NormalProducer {
    public static void main(String[] args) throws IOException, TimeoutException {
        //声明一个连接对象
        Connection connection = Utils.getConnection();
        //创建一个对象
        Channel channel = connection.createChannel();
        //发送消息
        channel.basicPublish("normalExchange","back1",null,"NormalProducer 发送消息".getBytes());
        //
        channel.close();
        connection.close();
    }
}
